home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mgr / sparcmgr / doc.zoo / doc / usrman / doc.4 < prev    next >
Encoding:
Text File  |  1989-04-03  |  31.9 KB  |  1,429 lines

  1. '\"                        Copyright (c) 1988 Bellcore
  2. '\"                            All Rights Reserved
  3. '\"       Permission is granted to copy or use this program, EXCEPT that it
  4. '\"       may not be sold for profit, the copyright notice must be reproduced
  5. '\"       on copies, and credit should be given to Bellcore where it is due.
  6. '\"       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  7. '\"
  8. '\"    $Header: doc.4,v 4.1 88/06/29 17:04:59 bianchi Exp $
  9. '\"    $Source: /tmp/mgrsrc/doc/usrman/RCS/doc.4,v $
  10. .Fh m_nomenu
  11. .Fs m_nomenu 8 "Unselect a pop-up menu from the middle mouse button"
  12. Deselect all menus.
  13. No menu will pop-up when the middle
  14. mouse button is pressed.
  15. This call does not delete the menu, it simply disassociates it
  16. from the button.
  17. .Fe
  18. .Fh m_nomenu2
  19. .Fs m_nomenu2 8 "Unselect a pop-up menu from the end mouse button"
  20. Deselect all menus.
  21. No menu will pop-up when the right
  22. mouse button is pressed.
  23. This call does not delete the menu, it simply disassociates it
  24. from the button.  This macro should be combined with
  25. .Fr m_nomenu
  26.  but is separate for historical reasons.
  27. .Fe
  28. .Fh m_othersave id sub name
  29. .Fs m_othersave 5 "Save another client's window image in a file"
  30. The bitmap contents of the window identified as
  31. .Fi id . sub
  32. is saved in the file
  33. .Fi name
  34. in bitmap format (see 
  35. .I dump.h
  36. for a description of the bitmap format).
  37. The
  38. .I "window id"
  39. can be determined either by calling
  40. .Fr m_getinfo G_ALL
  41.  or
  42. from the event
  43. .SM
  44. .I  M_ACCEPT
  45. .LG
  46. (see
  47. .Fr m_setevent
  48. ).
  49. See also
  50. .Fr m_windowsave
  51.  and
  52. .Fr m_bitsave
  53. \&.
  54. .Fe
  55. .Fh m_pagemenu parent child
  56. .Fs m_pagemenu 8 "Break a large menu into pages"
  57. Connect menu 
  58. .Fi child
  59. to the bottom of menu 
  60. .Fi parent
  61. to permit
  62. a long menu to be paged.
  63. Mousing off the bottom of the
  64. .Fi parent 
  65. menu automatically pops-up the
  66. .I child
  67. menu, which
  68. in turn may be the parent of another menu.
  69. See also
  70. .Fr m_unpagemenu
  71. ,
  72. .Fr m_linkmenu
  73.  and
  74. .Fr m_unlinkmenu
  75. \&.
  76. .Fe
  77. .Fh m_pop
  78. .Fs m_pop 10 "Pop the window context"
  79. Pop the window context.
  80. The last window context saved by calling
  81. .Fr m_push
  82.  or
  83. .Fr m_pushsave
  84.  is restored.
  85. If no environments have been pushed,
  86. .Fr m_pop
  87. is ignored.
  88. .Fe
  89. .Fh m_popall
  90. .Fs m_popall 10 "Pop all stacked window contexts"
  91. Like
  92. .Fr m_pop
  93. above, except all environments pushed since the 
  94. first call to
  95. .Fr m_setup
  96. are popped.
  97. The macro
  98. .Fr m_popall
  99.  is typically
  100. used as part of the clean up before
  101. client program termination.
  102. .Fe
  103. .Fh m_printstr string
  104. .Fs m_printstr 2 "Print a string on the window"
  105. Print
  106. .Fi string
  107. on the window at the current character cursor location.
  108. This is equivalent to the
  109. .I stdio
  110. function
  111. .I printf
  112. with a 
  113. .I %s
  114. format specified and the output directed toward the file pointer
  115. .I m_termout
  116. instead of
  117. .I stdout .
  118. .Fe
  119. .Fh m_push mode
  120. .Fs m_push 10 "Stack the window context"
  121. Certain parts (stack modes) of the current window environment may
  122. be moved to a stack, to be restored at a later time with
  123. .Fr m_pop
  124. or
  125. .Fr m_popall
  126. \&.
  127. Any combination of the following pieces of the
  128. window environment, called a window context,
  129. may be placed on the window stack.
  130. .RS
  131. .IP \fBP_BITMAP\fP 0.5i
  132. .br
  133. All currently defined
  134. .I scratchpad
  135. bitmaps
  136. are moved to the stack and become undefined in the current window context.
  137. .IP \fBP_CURSOR\fP 0.5i
  138. .br
  139. The current
  140. .I character
  141. cursor
  142. and
  143. .I "graphics point"
  144. positions are saved on the stack.
  145. .IP \fBP_EVENT\fP 0.5i
  146. .br
  147. All currently defined events are moved to the stack and
  148. become undefined in the current window context.
  149. .IP \fBP_FLAGS\fP 0.5i
  150. .br
  151. The window modes, as set with
  152. .Fr m_setmode
  153. are moved to the stack.
  154. The modes revert to their default settings in the current window context.
  155. .IP \fBP_FONT\fP 0.5i
  156. .br
  157. The current font setting is copied to the stack.
  158. If this font is subsequently deleted, by writing over it with a different
  159. font, the original font setting is retained, even if it can no longer
  160. be accessed using
  161. .Fr m_font
  162. \&.
  163. .IP \fBP_MENU\fP 0.5i
  164. .br
  165. All downloaded menus and menu links are moved to the the stack along with
  166. the currently selected menu number.
  167. The menus become undefined in the current context.
  168. .IP \fBP_MOUSE\fP 0.5i
  169. .br
  170. The mouse cursor location
  171. is saved on the stack.
  172. Its current location remains the same.
  173. .IP \fBP_POSITION\fP 0.5i
  174. .br
  175. The window size and location is saved on the stack.
  176. The current size and location are maintained.
  177. .IP \fBP_TEXT\fP 0.5i
  178. .br
  179. The text region location and size are saved on the stack.
  180. The text region in the current context is reset to the entire window.
  181. .IP \fBP_WINDOW\fP 0.5i
  182. .br
  183. The current image contents of the window is copied to the stack.
  184. This is done without altering the current contents of the window.
  185. .RE
  186. Stack modes are combined by
  187. .I or -ing
  188. them together
  189. to form a saved window context, such as:    
  190. .Fr m_push P_MENU|P_EVENT 
  191.  which will save all events, and menus but leave everything else
  192. alone.
  193. All stack modes that
  194. require client download data revert to their default settings
  195. when they are
  196. .I pushed .
  197. For example, after
  198. .Fr m_push P_MENU|P_EVENT|P_MOUSE
  199.  is called, no
  200. events or menus are currently defined,
  201. but the mouse remains where it is.
  202. The defined constant
  203. .SM
  204. .I P_ALL
  205. .LG
  206. refers to all of the modes.
  207. .Fe
  208. .Fh m_pushsave mode
  209. .Fs m_pushsave 10 "Stack and save the window context"
  210. Certain parts (stack modes) of the current window environment may
  211. be copied to a stack, to be restored at a later time with
  212. .Fr m_pop
  213. or
  214. .Fr m_popall
  215. \&.
  216. The macro
  217. .Fr m_pushsave
  218.  differs from
  219. .Fr m_push
  220. in that downloaded data, such as
  221. .I menus
  222. .I events
  223. or
  224. .I scratchpad
  225. bitmaps
  226. are copied to the stack instead of moved,
  227. and thus remain in effect after the call to
  228. .Fr m_pushsave
  229. \&.
  230. The current window context is thus unaffected.
  231. Any combination of the following pieces of the
  232. window environment may be copied to the window stack.
  233. .RS
  234. .IP \fBP_BITMAP\fP 0.5i
  235. .br
  236. All currently defined
  237. .I scratchpad
  238. bitmaps
  239. are copied to the stack.
  240. .IP \fBP_CURSOR\fP 0.5i
  241. .br
  242. The current
  243. .I character
  244. and
  245. .I graphics
  246. cursor positions are saved on the stack.
  247. .IP \fBP_EVENT\fP 0.5i
  248. .br
  249. All currently defined events are copied to the stack.
  250. .IP \fBP_FLAGS\fP 0.5i
  251. .br
  252. The window modes, as set with
  253. .Fr m_setmode
  254. , are copied to the stack.
  255. .IP \fBP_FONT\fP 0.5i
  256. .br
  257. The current font setting is copied to the stack.
  258. If this font is subsequently deleted, by writing over it with a different
  259. font, the original font setting is retained, even if it can no longer
  260. be accessed using
  261. .Fr m_font
  262. \&.
  263. .IP \fBP_MENU\fP 0.5i
  264. .br
  265. All downloaded menus and menu links are copied to the the stack along with
  266. the currently selected menu number.
  267. .IP \fBP_MOUSE\fP 0.5i
  268. .br
  269. The mouse cursor location
  270. is saved on the stack.
  271. .IP \fBP_POSITION\fP 0.5i
  272. .br
  273. The window size and location are saved on the stack.
  274. .IP \fBP_TEXT\fP 0.5i
  275. .br
  276. The text region location and size are saved on the stack.
  277. .IP \fBP_WINDOW\fP 0.5i
  278. .br
  279. The current image contents of the window is copied to the stack.
  280. .RE
  281. Stack modes are combined by
  282. .I or -ing
  283. them together 
  284. to form a saved window context, such as:    
  285. .Fr m_push P_MENU|P_EVENT 
  286.  which will save all events, and menus but leave everything else
  287. alone.
  288. .Fe
  289. .Fh m_put string
  290. .Fs m_put 12 "Save characters in the global snarf buffer"
  291. .Fi String
  292. is put into the global
  293. .I snarf
  294. buffer.
  295. There is one common buffer
  296. for all clients programs.
  297. The macro
  298. .Fr m_snarf
  299.  is used to retrieve the contents of the buffer.
  300. The \*M system
  301. .I cut
  302. function places text in this buffer, whereas 
  303. the system
  304. .I paste
  305. function pastes text from this buffer.
  306. .Fe
  307. .Fh m_putchar c
  308. .Fs m_putchar 2 "Put a character on the window"
  309. The character
  310. .Fi c
  311. is written in the window at the current character cursor
  312. location.
  313. This function is like the
  314. .I stdio
  315. .I putchar(c) ,
  316. only directed toward the client's window.
  317. .Fe
  318. .Fh m_rcircle radius
  319. .Fs m_rcircle 4 "Draw a circle at the graphics point"
  320. A circle of radius
  321. .Fi radius
  322. is drawn, centered at
  323. the current
  324. .I "graphics point" .
  325. The points at the edge of the circle are
  326. set, cleared or inverted
  327. depending upon the last call to
  328. .Fr m_func
  329. \&.
  330. Circles are always drawn as circles, both in
  331. .I absolute
  332. and in
  333. .I relative
  334. window coordinates.
  335. The
  336. .Fi radius
  337. is scaled based upon the average
  338. .Fi width
  339. and
  340. .Fi height
  341. of the window.
  342. .Fe
  343. .Fh m_rellipse radius1 radius2
  344. .Fs m_rellipse 4 "Draw an ellipse at the graphics point"
  345. Draw an ellipse centered at
  346. the
  347. .I "graphics point" .
  348. The two radii,
  349. .Fi radius1
  350. and
  351. .Fi radius2
  352. specify the major and minor axis.
  353. The ellipse is either
  354. set, cleared, or inverted
  355. determined by the last call to
  356. .Fr m_func
  357. \&.
  358. If the window is in
  359. .I relative
  360. coordinate mode,
  361. .Fi radius1
  362. and
  363. .Fi radius2
  364. are scaled based upon the average
  365. .Fi width
  366. and
  367. .Fi height
  368. of the window.
  369. .Fe
  370. .Fh m_resetesc
  371. .Fs m_resetesc 1 "Restore the \*M escape character to '\\e033'"
  372. The \*M
  373. .I escape
  374. character is reset to its to default value ('\e033').
  375. This turns off the debugging mode turned on by
  376. .Fr m_setesc
  377. \&.
  378. .Fh m_rfastdraw count data
  379. .Fs m_rfastdraw 4 "Draw a group of fast vectors at the graphics point"
  380. The next
  381. .Fi count
  382. bytes of
  383. .Fi data
  384. are sent to \*M are to be interpreted as lines drawn in
  385. .I "fast draw"
  386. mode,
  387. starting at
  388. the current graphics point.
  389. .I "Fast draw"
  390. mode permits the rapid drawing of short vectors
  391. by encoding an 
  392. .I x,y
  393. displacement in a single byte.
  394. The 
  395. .I x
  396. coordinate is contained in the most significant
  397. 4 bits, the
  398. .I y
  399. coordinate in the least significant 4 bits.
  400. Values for
  401. .I x
  402. and
  403. .I y
  404. represent displacements from the previous location, and
  405. range from +7 to -8.
  406. A 7 is coded as 
  407. .B 0xff ,
  408. a -8 as
  409. .B 0x00 .
  410. If both 
  411. .I x
  412. and
  413. .I y
  414. are zero (i.e.
  415. .B 0x8080 ).
  416. The next coordinate is taken to be a
  417. .I move
  418. instead of a
  419. .I draw.
  420. An eight bit channel between \*M and the client program is required for
  421. .I "fast draw"
  422. mode.
  423. See also
  424. .Fr m_fastdraw
  425. \&.
  426. .Fe
  427. .Fh m_right n
  428. .Fs m_right 13 "Move character cursor right by tenths of a character width"
  429. Move the character cursor right 
  430. .Fi n
  431. tenths of a character width.
  432. See also
  433. .Fr m_left
  434. .Fr m_down
  435. and 
  436. .Fr m_up
  437. \&.
  438. .Fe
  439. .Fh m_scrollregion first_row last_row
  440. .Fs m_scrollregion 3 "Set up a VT00 like scrolling region"
  441. This sets up a
  442. .I "text region"
  443. as a
  444. .I  VT100-like
  445. scrolling region.
  446. The entire width of the window
  447. from lines
  448. .Fi first_row
  449. to
  450. .Fi last_row
  451. inclusive becomes the 
  452. .I "text region" .
  453. See also
  454. .Fr m_textregion
  455. \&.
  456. .Fe
  457. .Fh m_selectmenu n
  458. .Fs m_selectmenu 8 "Select a pop-up menu for the middle mouse button"
  459. This macro is used to indicate menu 
  460. .Fi n
  461. pops-up in response to pressing
  462. the
  463. .I middle
  464. mouse button.
  465. Menus are downloaded (with
  466. .Fr m_loadmenu
  467. ) first, then selected.
  468. Only one menu may be selected at a time on each button.
  469. If the button is already down when this call is made, and there is not currently
  470. a menu associated with the button, then the menu just selected pops-up
  471. immediately.
  472. This last feature may be used to pop up different menus 
  473. in a context sensitive way.
  474. .Fe
  475. .Fh m_selectmenu2 n
  476. .Fs m_selectmenu2 8 "Select a pop-up menu for the right mouse button"
  477. This macro is used to indicate menu 
  478. .Fi n
  479. pops-up in response to pressing
  480. the
  481. .I right
  482. mouse button.
  483. Menus are downloaded (with
  484. .Fr m_loadmenu
  485. ) first, then selected.
  486. This macro functions the same as, and should be combined with
  487. .Fr m_selectmenu
  488.  above, but exists separately for historical reasons.
  489. .Fe
  490. .Fh m_selectwin n
  491. .Fs m_selectwin 11 "Select an alternate window for output"
  492. Select alternate window
  493. .Fi n
  494. for output.
  495. Alternate windows are
  496. first created by
  497. .Fr m_newwin
  498. \&.
  499. All output goes to the selected
  500. window until either
  501. .Fr m_selectwin
  502. is called to change windows,
  503. or the selected window is destroyed.
  504. If
  505. .Fi n
  506. is 0 (zero) or the currently selected window is destroyed,
  507. the main, or original window is selected.
  508. Input from all windows is
  509. send to the client program on the same input channel.
  510. The macro
  511. .Fr m_setevent ACTIVATE
  512.  may be used to help decide what window generated the input
  513. by associating a unique string with each window's 
  514. .SM
  515. .I ACTIVATE
  516. .LG
  517. event.
  518. The
  519. .I selected
  520. window 
  521. and the
  522. .I active
  523. window are specified independently.
  524. Selecting a window does not make it the 
  525. .I active 
  526. window, and creating a new window, although it is created as the 
  527. .I active
  528. window, is not automatically selected.
  529. .Fe
  530. .Fh m_sendme string
  531. .Fs m_sendme 12 "Send string back to self"
  532. The argument
  533. .Fi string
  534. is sent back to the client process
  535. as if it was typed in at the keyboard.
  536. .Fe
  537. .Fh m_sendto n string
  538. .Fs m_sendto 12 "Send a message to another window"
  539. The message
  540. .Fi string
  541. is send to window
  542. .Fi n .
  543. A unique window identifier,
  544. .Fi n 
  545. is determined with either
  546. .Fr m_setevent
  547.  using the 
  548. .B %w
  549. option,
  550. or with
  551. .Fr m_getinfo
  552. \&.
  553. In general, the window id
  554. .Fi n
  555. is the process id (\c
  556. .I pid )
  557. of the client program started by \*M
  558. when the window was created.
  559. If the target window has turned on
  560. .SM
  561. .B ACCEPT
  562. .LG
  563. with
  564. .Fr m_setevent
  565. ,
  566. .Fi string
  567. is received by the client program associated with the target window
  568. as part of the
  569. .SM
  570. .B ACCEPT
  571. .LG
  572. event.
  573. General write permissions must be disabled on the target client's
  574. .I pseudo tty
  575. in order for the message to be received, to prevent unsuspecting 
  576. .I shell s
  577. from interpreting messages sent by unscrupulous processes as commands.
  578. See also
  579. .Fr m_broadcast
  580. \&.
  581. .Fe
  582. .Fh m_setcursor i
  583. .Fs m_setesc 3 "Change the character cursor representation"
  584. The character cursor may be set to one of
  585. CS_BLOCK, CS_LEFT, CS_RIGHT, CS_BOX, CS_UNDER, or CS_INVIS which 
  586. sets the cursor representation to a solid block (the default), 
  587. a verticle bar at the left edge of the character cell, a verticle bar at
  588. the right edge, an outline box, or an underscore respectively.  CS_INVIS, 
  589. or any other invalid code causes the character cursor to be invisible.
  590. This macro currently only effects the cursor representation for the 
  591. active window.
  592. .Fe
  593. .Fh m_setesc c
  594. .Fs m_setesc 1 "Change the \*M escape character (for debugging)"
  595. This macro call causes the character
  596. .Fi c
  597. to be used as the \*M
  598. escape character by the library package (instead of 
  599. .I '\e033' ).
  600. This permits viewing
  601. the output stream to \*M without causing the commands to
  602. be executed.
  603. .Fe
  604. .Fh m_setecho
  605. .Fs m_setecho 1 "Turn on terminal character echo"
  606. Turn on character echoing, if possible.
  607. Character echoing is normally disabled by clients to inhibit information
  608. from \*M, as from calls to 
  609. .Fr m_getinfo
  610. , from echoing on the window.
  611. .Fe
  612. .Fh m_setevent n string
  613. .Fs m_setevent 9 "Set an event"
  614. An event string,
  615. .Fi string
  616. is sent to the client program by \*M upon the
  617. occurrence of the specified event
  618. .Fi n .
  619. The event string is typically
  620. read by the client program using
  621. .Fr m_gets
  622. \&.
  623. Event strings are never sent in response to an event unless specifically
  624. requested by the client program.
  625. Events are one of the following types.
  626. .RS
  627. .IP \fBACTIVATE\fP 0.5i
  628. .br
  629. The window became the
  630. .I active
  631. window.
  632. It is at the front of the display, and is currently receiving
  633. both mouse and keyboard input.
  634. .IP \fBBUTTON_1\fP 0.5i 
  635. .br
  636. The right
  637. mouse button was depressed.
  638. This event is sent only to the
  639. .I active
  640. window.
  641. .IP \fBBUTTON_1U\fP 0.5i
  642. .br
  643. The right mouse button was released.
  644. This event is sent only to the
  645. .I active
  646. window.
  647. .IP \fBBUTTON_2\fP 0.5i
  648. .br
  649. The middle mouse button was depressed.
  650. This event is sent only to the
  651. .I active
  652. window.
  653. .IP \fBBUTTON_2U\fP 0.5i
  654. .br
  655. The middle mouse button was released.
  656. This event is sent only to the
  657. .I active
  658. window.
  659. .IP \fBCOVERED\fP 0.5i
  660. .br
  661. The window was partially or completely obscured by another window.
  662. .IP \fBDEACTIVATE\fP 0.5i
  663. .br
  664. The window was deactivated, it is no longer the
  665. .I active
  666. window.
  667. .IP \fBREDRAW\fP 0.5i
  668. .br
  669. The display was redrawn, either by
  670. selecting the
  671. .I redraw
  672. option from the system menu, or by keying
  673. .I \s-2LEFT\s+2-r
  674. from the keyboard.
  675. Only windows that are exposed receive the 
  676. .SM
  677. .I REDRAW
  678. .LG
  679. event.
  680. The images of obscured windows are restored automatically by \*M.
  681. The client program is expected to regenerate the contents of its
  682. window in response to the
  683. .SM
  684. .I REDRAW
  685. .LG
  686. event.
  687. .IP \fBRESHAPE\fP 0.5i
  688. .br
  689. The window was reshaped.
  690. If the user selects the system
  691. .I reshape
  692. option,
  693. the 
  694. .SM
  695. .I RESHAPE
  696. .LG
  697. event is sent, even if the window stays the same shape.
  698. .IP \fBUNCOVERED\fP 0.5i
  699. .br
  700. The window, previously obscured, was uncovered.
  701. If the window also became the 
  702. .I active 
  703. window, the
  704. .SM
  705. .I UNCOVERED
  706. .LG
  707. event is sent
  708. before the
  709. .SM
  710. .I ACTIVATE
  711. .LG
  712. event.
  713. .IP \fBMOVE\fP 0.5i
  714. .br
  715. The window was moved.
  716. .IP \fBDESTROY\fP 0.5i
  717. .br
  718. The window was destroyed.
  719. Only
  720. .I alternate
  721. windows
  722. (as created by
  723. .Fr m_newwin
  724. ) cause 
  725. .SM
  726. .I DESTROY
  727. .LG
  728. events to be sent.
  729. If the
  730. .I main 
  731. window is destroyed,
  732. the client program is sent a
  733. .I hangup
  734. signal, and its connection
  735. to \*M is severed.
  736. .IP \fBACCEPT\fP 0.5i
  737. .br
  738. Messages are accepted from client programs running in other windows
  739. (see
  740. .Fr m_sendto
  741. \&).
  742. The content of the message is obtained by specifying the 
  743. .Fi %m
  744. parameter as part of the event string, as is fully described below.
  745. .IP \fBNOTIFY\fP 0.5i
  746. .br
  747. Register a name with \*M, and make this name available to client programs.
  748. This name is available to other clients, either by a call to 
  749. .Fr m_getinfo G_NOTIFY
  750.  or with the
  751. .Fi %n
  752. parameter described below.
  753. Unlike the other events, 
  754. the
  755. .I notify
  756. string is never sent back to the client program by \*M, but is
  757. used to register a name for the window.
  758. .IP \fBSNARFED\fP 0.5i
  759. .br
  760. Text was put into the snarf buffer either by a client program with
  761. .Fr m_put
  762.  or by use of the system
  763. .I cut
  764. function.
  765. .IP \fBPASTE\fP 0.5i
  766. .br
  767. Text is about to arrive as a result of the system
  768. .I paste function.
  769. .RE
  770.  
  771. Some
  772. .I event
  773. strings may contain substitutable parameters in the
  774. manner of
  775. .I printf
  776. format specifiers (i.e. %X).
  777. These parameters
  778. are applicable only to certain types of events.
  779. In any case, the
  780. .B %
  781. character may be forced by doubling it, as in
  782. .B %% .
  783. Where more than one data item replaces the format specifier, 
  784. the items are separated by 
  785. a
  786. .I space
  787. character.
  788. For the event strings
  789. .Fi BUTTON_1
  790. and
  791. .Fi BUTTON_2 ,
  792. several parameters cause \*M to sweep out some object in response to
  793. mouse movement, and report back the size of the swept object when the button
  794. is released.
  795. Any one of lines, boxes, text, or rectangles may be swept out with 
  796. this mechanism.
  797. Initial parameters may be associated with a sweep event by listing them
  798. as comma separated integers following the 
  799. .B %
  800. and preceding the sweep command character.
  801. The parameters (if any) set the initial size of the object to be swept, 
  802. in the same coordinate system in which the sweep extend is reported.
  803. .RS
  804. .IP \fB%r\fP 0.5i
  805. Depressing the button causes \*M to
  806. sweep out a rectangle in response to moving the mouse,
  807. in a manner similar to the system
  808. .I reshape
  809. function.
  810. The initial parameters set the initial width and height of the rectangle.
  811. When the button is released,
  812. the coordinates of the
  813. .I starting
  814. and
  815. .I ending
  816. points of the rectangle in response to moving the mouse, in
  817. .I window
  818. coordinates,
  819. are substituted for the
  820. .B %r .
  821. .IP \fB%R\fP 0.5i
  822. Depressing the button causes \*M to
  823. sweep out a rectangle,
  824. as in
  825. .B %r
  826. above,
  827. only the result is reported in 
  828. .I display coordinates.
  829. .IP \fB%b\fP 0.5i
  830. Depressing the button causes \*M to
  831. move a rectangle in response to moving the mouse,
  832. in a manner similar to the system
  833. .I move
  834. function.
  835. The initial parameters set the initial width and height of the rectangle
  836. to be moved.
  837. When the button is released,
  838. the current coordinates of the box's corner
  839. is returned in
  840. .I window
  841. coordinates,
  842. substituted for the
  843. .B %b .
  844. .IP \fB%B\fP 0.5i
  845. Depressing the button causes \*M to
  846. move a rectangle in response to moving the mouse,
  847. in a manner similar to the system
  848. .I move
  849. function.
  850. The initial parameters set the initial width and height of the rectangle
  851. to be moved.
  852. When the button is released,
  853. the current coordinates of the box's corner
  854. is returned in
  855. .I display
  856. coordinates,
  857. substituted for the
  858. .B %b .
  859. .IP \fB%l\fP 0.5i
  860. Depressing the button causes \*M to
  861. sweep out a line.
  862. One end of the line remains fixed at the
  863. .I "graphics point"
  864. while the other end of the line tracks the mouse position.
  865. The initial end point of the line may be specified as a displacement
  866. from the graphics point as part of the initial parameters.
  867. When the button is released,
  868. the coordinates of the
  869. .I starting
  870. and
  871. .I ending
  872. points of the line, in
  873. .I window
  874. coordinates,
  875. are substituted for the
  876. .B %l .
  877. .IP \fB%t\fP 0.5i
  878. Depressing the button causes \*M to
  879. sweep out text, in a manner equivalent to the system
  880. .I cut
  881. function.
  882. Upon the release of the button, the
  883. .B %t
  884. is replaced by the starting character coordinate of the 
  885. .I cut
  886. region, followed by character distance to the ending point
  887. in columns and lines respectively.
  888. For example, The event string 
  889. \fIsweep[\fP\fB%t\fP\fI]\fP
  890. might return
  891. \fIsweep[\fP\fB17 5 6 0\fP\fI]\fP,
  892. indicating the user swept out a six character word on a single
  893. line, starting on
  894. .Fi column
  895. 17,
  896. .Fi row
  897. 5.
  898. An initial size may be specified in number of rows and number of
  899. columns.
  900. .RE
  901. The remaining format specifiers are replaced by the information
  902. described below No sweep action is performed.  The first three, %p, %P,
  903. and %M also apply to the button release events.
  904. to button releases.
  905. .RS
  906. .IP \fB%p\fP 0.5i
  907. The
  908. .B %p
  909. is replaced by the current mouse coordinates, in
  910. .I window
  911. coordinates.
  912. .IP \fB%P\fP 0.5i
  913. The
  914. .B %P
  915. is replaced by the current mouse coordinates, in
  916. .I character
  917. coordinates.
  918. .IP \fB%M\fP 0.5i
  919. The
  920. .B %M
  921. is replaced by the time in hundredths of seconds that have elapsed
  922. since \*M was started.
  923. .IP \fB%n\fP 0.5i
  924. If the mouse cursor is over a window whose
  925. .SM
  926. .Fi NOTIFY
  927. .LG
  928. event is set,
  929. the text of that message is substituted for the
  930. .B %n .
  931. .IP \fB%w\fP 0.5i
  932. If the mouse cursor is over a window whose
  933. .SM
  934. .Fi NOTIFY
  935. .LG
  936. event is set,
  937. the 
  938. .Fi window_id
  939. of the clicked on window
  940. is substituted for the
  941. .B %w .
  942. This
  943. .Fi window_id
  944. may be used by
  945. .Fr m_sendto
  946. to send the clicked-on window a message.
  947. .IP \fB%S\fP 0.5i
  948. If the mouse cursor is over a window whose
  949. .SM
  950. .Fi NOTIFY
  951. .LG
  952. event is set,
  953. the length of that message is substituted for the
  954. .B %S .
  955. .RE
  956. .sp
  957. The 
  958. .SM
  959. .Fi ACCEPT
  960. .LG
  961. event is used to receive messages from other client programs.
  962. The following substituteable parameters may be used as part of the
  963. event string.
  964. .RS
  965. .IP \fB%f\fP 0.5i
  966. The
  967. .Fi window_id
  968. of message sender, as used in
  969. .Fr m_sendto
  970. , replaces the
  971. .B %f .
  972. .IP \fB%m\fP 0.5i
  973. The text of message sent by the other client program
  974. replaces the
  975. .B %m
  976. .IP \fB%s\fP 0.5i
  977. The length of the message, in characters,
  978. replaces the
  979. .B %s .
  980. For example, a call to
  981. .TS
  982. center box;
  983. c.
  984. m_setevent(ACCEPT,"Message from (\fB%f\fP), (\fB%s\fP) long is: \fB%m\fP")
  985. .TE
  986. might cause \*M to return
  987. .TS
  988. center box;
  989. c.
  990. Message from (\fB3214\fP), (\fB2\fP) long is: \fBHI\fP
  991. .TE
  992. after the client program whose
  993. .I "window id"
  994. is
  995. .I 3214
  996. uses
  997. .Fr m_sendto
  998. to send the message
  999. \fI"HI\|"\fP.
  1000. .IP \fB%p\fP 0.5i
  1001. As with the 
  1002. .SM
  1003. .Fi BUTTON
  1004. .LG
  1005. events above,
  1006. .B %p
  1007. is replaced by the current mouse position in
  1008. .I window
  1009. coordinates.
  1010. .IP \fB%P\fP 0.5i
  1011. As with the 
  1012. .SM
  1013. .Fi BUTTON
  1014. .LG
  1015. events above,
  1016. .B %P
  1017. is replaced by the current mouse position in
  1018. .I character
  1019. coordinates.
  1020. .RE
  1021. For the
  1022. .SM
  1023. .Fi SNARFED
  1024. .LG
  1025. event string,
  1026. the following substitution parameters are recognized.
  1027. .RS
  1028. .IP \fB%f\fP 0.5i
  1029. The 
  1030. .I "window id"
  1031. of the window filling the
  1032. .I snarf
  1033. buffer replaces the
  1034. .B %f .
  1035. .IP \fB%c\fP 0.5i
  1036. The current length of the
  1037. .I snarf
  1038. buffer, in characters,
  1039. replaces the
  1040. .B %c .
  1041. .IP \fB%C\fP 0.5i
  1042. The contents of the 
  1043. .I snarf
  1044. buffer replaces the
  1045. .B %C .
  1046. At present, only the first 250 characters of the 
  1047. .I snarf
  1048. buffer may be returned via the
  1049. .B %C
  1050. parameter.
  1051. Use
  1052. .Fr m_snarf
  1053. to read the entire buffer.
  1054. .RE
  1055. .sp
  1056. The
  1057. .SM
  1058. .Fi PASTE
  1059. .LG
  1060. event string,
  1061. recognizes the
  1062. .B %c
  1063. specifier as described under
  1064. .SM
  1065. .I SNARFED
  1066. .LG
  1067. above.
  1068. .Fe
  1069. .Fh m_setmode mode
  1070. .Fs m_setmode 6 "Set a window mode"
  1071. Various window modes may be
  1072. .I set
  1073. or
  1074. .I cleared
  1075. (see
  1076. .Fr m_clearmode
  1077. )
  1078. independently.
  1079. These modes are:
  1080. .RS
  1081. .IP \fBM_STANDOUT\fP 0.5i
  1082. The window is put in standout mode.
  1083. All characters
  1084. are written with their foreground and background
  1085. colors reversed.
  1086. .IP \fBM_WOB\fP 0.5i
  1087. The sense of
  1088. .I white
  1089. and
  1090. .I black
  1091. is reversed for the entire window,
  1092. not just for characters as is
  1093. .SM
  1094. .B M_STANDOUT .
  1095. .LG
  1096. .IP \fBM_AUTOEXPOSE\fP 0.5i
  1097. The next character to be typed on the window
  1098. causes it to automatically become the
  1099. .I active
  1100. window.
  1101. .IP \fBM_BACKGROUND\fP 0.5i
  1102. Output goes to the window even if it is 
  1103. partially or totally obscured.
  1104. The data in exposed portions of the window is seen immediately.
  1105. Data in covered portions of the window is saved by \*M and restored 
  1106. when the covered portions are exposed.
  1107. .IP \fBM_NOINPUT\fP 0.5i
  1108. Keyboard input is prohibited.
  1109. All input from
  1110. the keyboard is held buffered by \*M until
  1111. either
  1112. .SM
  1113. .B M_NOINPUT
  1114. .LG
  1115. is cleared, or a different
  1116. window is made the
  1117. .I active
  1118. window.
  1119. In the latter case
  1120. the input goes to the newly activated
  1121. window.
  1122. This flag is automatically turned
  1123. off when the user activates the window.
  1124. This feature is for client programs that want one of their
  1125. windows to come to the front just long enough to notify the
  1126. user of some event, but do not want to accidently intercept keyboard
  1127. input while the user is merrily typing to some other client.
  1128. .IP \fBM_NOWRAP\fP 0.5i
  1129. The character cursor does not automatically jump to the left edge of
  1130. the next line as it reaches the right edge of its text region.
  1131. After the right margin is passed,
  1132. the cursor and any subsequent text disappear past the right
  1133. edge of the window.
  1134. .IP \fBM_OVERSTRIKE\fP 0.5i
  1135. Text is written to the window with the mode
  1136. specified by
  1137. .Fr m_func
  1138.  instead of the normal
  1139. copy mode.
  1140. In copy mode, the characters completely obliterate their destination
  1141. instead of combining with it.
  1142. .IP \fBM_ABS\fP 0.5i
  1143. .br
  1144. The window is set to 
  1145. .I absolute
  1146. coordinate mode.
  1147. The upper left edge of the window, just inside
  1148. the border is at position
  1149. .Fr "" 0  0
  1150. \&.
  1151. All other locations
  1152. are measured relative to that corner in pixels.
  1153. .IP \fBM_ACTIVATE\fP 0.5i
  1154. The window is made the
  1155. .I active
  1156. window,  pops to the front of the display,
  1157. and obtains all keyboard and mouse input.
  1158. .IP \fBM_SNARFLINES\fP 0.5i
  1159. The system
  1160. .I cut
  1161. function only
  1162. cuts entire lines.
  1163. If any text on a line is swept out, the entire line of text
  1164. is included.
  1165. .IP \fBM_SNARFTABS\fP 0.5i
  1166. The system
  1167. .I cut
  1168. function attempts to turn
  1169. white space into a minimal combination of spaces and tabs.
  1170. Tab are set at every 8 columns.
  1171. .IP \fBM_SNARFHARD\fP 0.5i
  1172. The system
  1173. .I cut
  1174. function attempts to cut
  1175. text even if the window contents have been corrupted.
  1176. Unidentifyable characters are returned as
  1177. .I C_NOCHAR
  1178. (\'?\').
  1179. .IP \fBM_STACK\fP 0.5i
  1180. Any events pushed on the window stack
  1181. when this flag is set will be sent in addition to
  1182. any currently active events. 
  1183. This setting is useful for filters which need to receive events, yet
  1184. still permit clients running under them to receive events as well.
  1185. .RE
  1186. .Fe
  1187. .Fh m_setnoecho
  1188. .Fs m_setnoecho 1 "Turn off character echo"
  1189. Character echoing to the window is disabled if possible.
  1190. Character echoing is normally disabled by clients to inhibit information
  1191. from \*M, as from calls to 
  1192. .Fr m_getinfo
  1193.  from echoing on the window.
  1194. .Fe
  1195. .Fh m_setnoraw
  1196. .Fs m_setnoraw 1 "Enable normal character input processing (line mode)"
  1197. Normal terminal input processing is in effect.
  1198. Input is buffered by lines, and all normal line editting
  1199. and keyboard interrupt generation
  1200. is in effect.
  1201. .Fe
  1202. .Fh m_setraw
  1203. .Fs m_setraw 1 "Disable all character input processing (raw mode)"
  1204. Every character is available as entered, no input processing is 
  1205. done.
  1206. This is typically called
  1207. .I raw
  1208. mode.
  1209. Raw mode is not always available, in which case the macro call is
  1210. ignored.
  1211. .Fe
  1212. .Fh m_shapewindow X Y Dwidth Dheight
  1213. .Fs m_shapewindow 6 "Reposition a window"
  1214. The window is reshaped to
  1215. position
  1216. .Fr "" X Y
  1217.  and with size
  1218. .Fi Dwidth
  1219. by
  1220. .Fi Dheight .
  1221. As only the
  1222. .I active
  1223. window may be reshaped,
  1224. .Fr m_shapewindow
  1225. activates the window if it is not already active.
  1226. The new size of the window is not guaranteed;
  1227. the
  1228. .I width
  1229. or
  1230. .I height
  1231. may be truncated to the right or bottom edges of the display.
  1232. The macro
  1233. .Fr m_getinfo
  1234. can be used to determine the actual window size.
  1235. .Fe
  1236. .Fh m_size columns rows
  1237. .Fs m_size 6 "Resize a window to a specified number of rows and columns"
  1238. The size of the window is changed so that it fits exactly
  1239. .Fi columns
  1240. by
  1241. .Fi rows
  1242. of characters in the current font.
  1243. The window may be truncated at the right or bottom edge of the display
  1244. if it is too large to fit on the display at its current position.
  1245. .Fe
  1246. .Fh m_sizeall X Y columns rows
  1247. .Fs m_sizeall 6 "Reposition a window with a given number of rows and columns"
  1248. The window is reshaped to position
  1249. .Fr "" X Y
  1250.  on the display, and resized to fit
  1251. .Fi columns
  1252. and
  1253. .Fi rows
  1254. of text.
  1255. As only the
  1256. .I active
  1257. window may be reshaped,
  1258. .Fr m_shapewindow
  1259.  activates the window if it is not already active.
  1260. The new size of the window is not guaranteed;
  1261. the
  1262. .I width
  1263. or
  1264. .I height
  1265. may be truncated to the right or bottom edges of the display.
  1266. The macro 
  1267. .Fr m_getinfo
  1268. can be used to determine the actual window size.
  1269. .Fe
  1270. .Fh m_snarf
  1271. .Fs m_snarf 12 "Retrieve the contents of the global snarf buffer"
  1272. The application is sent the contents of the global snarf buffer,
  1273. if any, as specified by the last call by a client programs
  1274. call to
  1275. .Fr m_put
  1276.  or by use of the system
  1277. .I cut
  1278. function.
  1279. .Fe
  1280. .Fh m_sleep
  1281. .Fs m_sleep 13 "Do nothing"
  1282. This call causes \*M to suspend the processing
  1283. of characters to the window.
  1284. After a chunk of output for all other windows has been processed,
  1285. output processing resumes.
  1286. This does not normally take very long, making
  1287. .Fr m_sleep
  1288.  almost a 
  1289. .I no-op.
  1290. .Fe
  1291. .Fh m_standend
  1292. .Fs m_standend 3 "Turn off reverse video characters"
  1293. Inverse video mode as set by
  1294. .Fr m_standout
  1295.  is turned off.
  1296. This is exactly equivalent to
  1297. .Fr m_clearmode M_STANDOUT
  1298. \&.
  1299. .Fe
  1300. .Fh m_standout
  1301. .Fs m_standout 3 "Turn on reverse video characters"
  1302. Inverse video mode is turned on.
  1303. This is exactly equivalent to
  1304. .Fr m_setmode M_STANDOUT
  1305. \&.
  1306. The color of the characters and their backgrounds are interchanged.
  1307. .Fe
  1308. .Fh m_stringto to x_dst y_dst string
  1309. .Fs m_stringto 4 "Print a string to an scratchpad bitmap"
  1310. The text
  1311. .Fi string
  1312. is printed
  1313. starting at the location
  1314. .Fr "" x_dst y_dst
  1315.  on 
  1316. .I scratchpad
  1317. bitmap
  1318. .Fi to .
  1319. The text is clipped to fit in the bitmap, and no special command processing
  1320. is done on
  1321. .Fi string.
  1322. If 
  1323. .Fi to
  1324. is 0 (zero),
  1325. The text is printed on the window, but
  1326. .I "text region"
  1327. boundaries are ignored.
  1328. This is the only way to get text into a window outside of the
  1329. .I "text region" .
  1330. .Fe
  1331. .Fh m_textregion x y wide high
  1332. .fs 3 "create a text region"
  1333. A subregion within the current window
  1334. starting at
  1335. .Fr "" x y
  1336.  and of size
  1337. .Fi wide
  1338. by
  1339. .Fi high
  1340. is defined within which all text is restricted.
  1341. All functions and information that deals in
  1342. .I character
  1343. coordinates views the text region as if it was the entire window.
  1344. As soon as the text region is defined, the character cursor is
  1345. moved to row and column
  1346. .Fr "" 0 0
  1347. ,
  1348. which is now located at the point
  1349. .Fr "" x y
  1350. \&.
  1351. Graphics output is not affected by text regions.
  1352. .Fe
  1353. .Fh m_textreset
  1354. .Fs m_textreset 3 "Reset the text region to the entire window"
  1355. The
  1356. .I "text region"
  1357. (defined by a call to
  1358. .Fr m_textregion
  1359. ) is reset to be the entire window.
  1360. This is the default setting.
  1361. .Fe
  1362. .Fh m_unlinkmenu parent item
  1363. .Fs m_unlinkmenu 8 "Unlink a menu"
  1364. The menu link associating a child menu with
  1365. the menu
  1366. .Fi parent
  1367. at
  1368. .Fi item
  1369. (counting from zero) is removed
  1370. (see also
  1371. .Fr m_linkmenu
  1372. \&).
  1373. This function does not change the menus, only their
  1374. connections.
  1375. .Fe
  1376. .Fh m_unpagemenu parent
  1377. .Fs m_unpagemenu 8 "Disconnect two pages of a paged menu"
  1378. The link associating the menu
  1379. .Fi parent
  1380. with a
  1381. .I child
  1382. menu is removed.
  1383. See also
  1384. .Fr m_pagemenu
  1385. \&.
  1386. .Fe
  1387. .Fh m_up n
  1388. .Fs m_up 13 "Move character cursor up by tenths of a character height"
  1389. Move the character cursor up 
  1390. .Fi n
  1391. tenths of a character height.  This may cause the window to scroll down.
  1392. See also
  1393. .Fr m_left
  1394. .Fr m_right
  1395. and 
  1396. .Fr m_down
  1397. \&.
  1398. .Fe
  1399. .Fh m_whatsat X Y
  1400. .Fs m_whatsat 7 "Find out what is at a particular display location"
  1401. \*M returns to the client program a line indicating what is at the
  1402. .I display
  1403. coordinates
  1404. .Fr "" X Y
  1405. \&.
  1406. If that location is occupied by a window,
  1407. a line containing the window's controlling terminal, alternate window number,
  1408. and
  1409. .I "window id"
  1410. is returned in a space separated list.
  1411. If the location
  1412. .Fr "" X Y
  1413.  is not in a window, \*M returns a newline.
  1414. .Fe
  1415. .Fh m_windowsave name
  1416. .Fs m_windowsave 5 "Save the window image on a file"
  1417. The current image contents of the window is saved in the file
  1418. .Fi name
  1419. on the \*M-host machine in \*M bitmap
  1420. format.
  1421. File names beginning with "./" are evaluated relative to the current directory
  1422. when \*M was started.
  1423. See also
  1424. .Fr m_othersave
  1425.  and
  1426. .Fr m_bitsave
  1427. \&.
  1428. .Fe
  1429.